package com.testjpa.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 作者: ZJM
 * 日期: 2020/5/18 16:11
 * 描述:
 */
@RestController
public class ConsulController {

    @Value("${tttt}")
    private String tttt;

    @RequestMapping("test01")
    public String test01(){
       return tttt;
    }

    @Value("${server.port}")
    private String port;

    /**
     * 测试zuul的动态路由的功能
     * @return
     */
    @RequestMapping("test11")
    public String testZuul(HttpServletRequest httpServletRequest){
        Object zhangsan = httpServletRequest.getAttribute("zhangsan");
        System.out.println("========这里是consul-client1服务========="+zhangsan);

        return port+"========这里是consul-client1服务========="+zhangsan;

    }

}
